package com.wulin.wucut.utils;


import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FrameGrabber;


public class VideoUtil {
   
    /**
     * 获取视频总帧率
     * @param videoPath
     * @return
     * @throws FrameGrabber.Exception
     */
    public static long readVideoAllFrames(String videoPath) throws FrameGrabber.Exception {
    FFmpegFrameGrabber grabber = FFmpegFrameGrabber.createDefault(videoPath);
        return grabber.getLengthInFrames();
    }


    public static FFmpegFrameGrabber getGrabber(String path) throws FrameGrabber.Exception {
        return FFmpegFrameGrabber.createDefault(path);   
    }
    
    public static long getVideoInfo() {
        return 1;
    }
}
